Hi ALL,

Am using the below vbs script to get the full path or absolute path, from the current directory path. The current directory path is "D:\JAMER\TestCases\Hammy\TC2_Enabled_both"

The below script is used to get the full path of the current working directory to the file ScriptingFilePath.txt for later references,

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(".")
Set objFile = objFSO.CreateTextFile(".\ScriptingFilePath.txt")
strFull = wscript.ScriptFullName
strFull = objFolder.Path
objFile.Write(strFull)

When I run the vbs script seperately by double clicking on the script icon, am getting the proper full directory path (i.e) "D:\JAMER\TestCases\Hammy\TC2_Enabled_both"

But when calling from the windows batch file(content of batch file "cscript filename.vbs), am getting only short directory format as "D:\JAMER\Tes~s\Ham~y\TC2_E~th"

But I need the full path when I run from the batch file. Can you please help ?

Thanks,

Satish

It seems that you already found a solution HERE. Please mark this as solved so it can be closed properly, thank you.:)

For future members with the same problem, have a look at the above link for the solution.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.