Windows cannot find the path specified when using the %windir% location as a variable. Also, does anyone know if 64 bit computers have system 3s folders? I know that the variable works because i have used it in a messagebox. Here is my code, please help if you can.
set shell = WScript.CreateObject("WScript.Shell")
windowsdir = shell.ExpandEnvironmentStrings("%windir%")
MsgBox(windowsdir)
Dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run("""windowsdir & \System32\dvdplay.exe""")
Set objShell = Nothing
Sorry, i am trying to use this same method to create a folder and now i am getting a "bad file name or number" error. Please help if you can.
dim filesys, newfolder, newfolderpath
Dim oShell : Set oShell = CreateObject("WScript.Shell")
Dim sWinDir : sWinDir = oShell.ExpandEnvironmentStrings("%windir%")
sCmd = """" & sWinDir & "\System32\test"""
WScript.Echo 3, sCmd, "'concatenation' solution"
newfolderpath = """"& sCmd& ""
set filesys=CreateObject("Scripting.FileSystemObject")
If Not filesys.FolderExists(newfolderpath) Then
Set newfolder = filesys.CreateFolder(newfolderpath)
End If